
<%@ page import="auctionatr.User"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'user.label', default: 'User')}" />
<title><g:message code="default.show.label" args="[entityName]" />
</title>
</head>
<body>

	<h1>
		<g:message code="default.show.label" args="[entityName]" />
	</h1>
	<g:if test="${flash.message}">
		<div class="message">
			${flash.message}
		</div>
	</g:if>




	<table>
		<tbody>
			<g:if test="${userInstance?.avatar}">
				<tr>
					<td rowspan="18"><img class="avatar"
						src="${createLink(controller:'user', action:'avatarImage', id:fieldValue(bean: userInstance, field: "id"))}" />
					</td>
				</tr>
			</g:if>
			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.firstName.label" default="First Name" /></td>

				<td valign="top" class="value">
					${fieldValue(bean: userInstance, field: "firstName")}
				</td>

			</tr>

			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.lastName.label" default="Last Name" /></td>

				<td valign="top" class="value">
					${fieldValue(bean: userInstance, field: "lastName")}
				</td>

			</tr>

			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.username.label" default="Username" /></td>

				<td valign="top" class="value">
					${fieldValue(bean: userInstance, field: "username")}
				</td>

			</tr>


			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.email.label" default="Email" /></td>

				<td valign="top" class="value"><a
					href="mailto:${fieldValue(bean: userInstance, field: "email")}">
						${fieldValue(bean: userInstance, field: "email")} </a></td>

			</tr>






			<tr>
				<td></td>
				<td></td>
			</tr>

			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.aboutUser.label" default="About User" /></td>

				<td valign="top" class="value">
					${fieldValue(bean: userInstance, field: "aboutUser")}
				</td>

			</tr>

			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.facebookName.label" default="Facebook Name" /></td>

				<td valign="top" class="value"><a
					href="http://facebook.com/${fieldValue(bean: userInstance, field: "facebookName")}">facebook.com/${fieldValue(bean: userInstance, field: "facebookName")}
				</a></td>

			</tr>


			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.twitterName.label" default="Twitter Name" /></td>

				<td valign="top" class="value"><a
					href="http://twitter.com/${fieldValue(bean: userInstance, field: "twitterName")}">twitter.com/${fieldValue(bean: userInstance, field: "twitterName")}
				</a></td>

			</tr>
			
			<tr>
				<td></td>
				<td></td>
			</tr>
		

			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.dateCreated.label" default="Date Created" /></td>

				<td valign="top" class="value"><g:formatDate format="${message(code: 'default.date.format', default: 'DateFormat')}"
						date="${userInstance?.dateCreated}" /></td>

			</tr>

			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.lastUpdated.label" default="Last Updated" /></td>

				<td valign="top" class="value"><g:formatDate format="${message(code: 'default.date.format', default: 'DateFormat')}"
						date="${userInstance?.lastUpdated}" /></td>

			</tr>
			
			<g:if test="${session.admin == true || session?.userid.toString() == params?.id }">
			<tr>
				<td></td>
				<td></td>
			</tr>
			
						<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.street.label" default="Street" /></td>

				<td valign="top" class="value">
					${fieldValue(bean: userInstance, field: "street")}
				</td>

			</tr>

			<tr class="prop">
				<td valign="top" class="name"><g:message code="user.zip.label"
						default="Zip" /></td>

				<td valign="top" class="value">
					${fieldValue(bean: userInstance, field: "zip")}
				</td>

			</tr>

			<tr class="prop">
				<td valign="top" class="name"><g:message code="user.city.label"
						default="City" /></td>

				<td valign="top" class="value">
					${fieldValue(bean: userInstance, field: "city")}
				</td>

			</tr>

			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.accountNumber.label" default="Account Number" /></td>

				<td valign="top" class="value">
					${fieldValue(bean: userInstance, field: "accountNumber")}
				</td>

			</tr>

			<tr class="prop">
				<td valign="top" class="name"><g:message
						code="user.bankCode.label" default="Bank Code" /></td>

				<td valign="top" class="value">
					${fieldValue(bean: userInstance, field: "bankCode")}
				</td>

			</tr>

</g:if>
		</tbody>
	</table>

	<g:if
		test="${session?.userid.toString() == params.id || session?.admin == true}">

		<div class="buttons">
			<g:form action="edit">
				<g:hiddenField name="id" value="${userInstance?.id}" />
				<span class="button"><g:actionSubmit class="edit"
						action="edit"
						value="${message(code: 'default.button.edit.label', default: 'Edit')}" />
				</span>
				<span class="button"><g:actionSubmit class="delete"
						action="delete"
						value="${message(code: 'user.deleteaccount.label', default: 'Delete')}"
						onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
				</span>
			</g:form>
		</div>
	</g:if>


</body>
</html>
